<template>
  <div class="home">
    <!-- 嵌套路由,加上路由出口 -->
    <router-view></router-view>
    <!-- 配置路由模式，在上面加上route，在需要跳转的子标签栏上加上一个to对应组件的path -->
    <van-tabbar
      v-if="$route.meta.needTab"
      placeholder
      route
      active-color="#e40137"
      inactive-color="#b4b4bd"
    >
      <van-tabbar-item>
        <span>公司</span>
        <template #icon>
          <i class="iconfont f26">&#xe63d;</i>
        </template>
      </van-tabbar-item>
      <van-tabbar-item>
        <span>刷题</span>
        <template #icon>
          <i class="iconfont f26">&#xe63f;</i>
        </template>
      </van-tabbar-item>
      <van-tabbar-item to="/home/find">
        <span>发现</span>
        <template #icon>
          <i class="iconfont f26">&#xe63a;</i>
        </template>
      </van-tabbar-item>
      <van-tabbar-item to="/home/my">
        <span>我的</span>
        <template #icon>
          <i class="iconfont f26">&#xe645;</i>
        </template>
      </van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  data () {
    return {}
  }
}
</script>

<style lang="less">
.home {
  height: 100%;
  .f26 {
    font-size: 26px;
  }
}
</style>
